<template>
  <div>
    <el-button size="mini" type="success" @click="to">编辑</el-button>
    <eForm ref="form" :permissions="permissions" :company-levels="companyLevels" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    permissions: {
      type: Array,
      required: true
    },
    companyLevels: {
      type: Array,
      required: true
    },
    id: {
      type: Number,
      required: true,
      default: null
    },
  },
  data() {
    return {
      uid: this.id
    }
  },
  provide() {
    return {
      Edit: this
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = { compNo: this.data.compNo, compName: this.data.compName, compTypeName: this.data.compTypeName, compLevel: this.data.compLevel, contactAddr: this.data.contactAddr, tel: this.data.tel, id: this.id }
      _this.dialog = true
      console.log(_this.permissions, _this.companyLevels)
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
